var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', {user:req.session.user});
});

//注册
router.get('/register',(req,res)=>{
  res.render('register',{});
})

//登陆
router.get('/login',(req,res)=>{
  res.render('login',{})
})

//咨询管理
router.get('/article-list',(req,res)=>{
  res.render('article-list',{})
})

//图片管理
router.get('/picture-list',(req,res)=>{
  res.render('picture-list',{})
})

//评论管理
router.get('/feedback-list',(req,res)=>{
  res.render('feedback-list',{})
})

//产品管理(待处理)
// router.get('/product-list',(req,res)=>{
//   res.render('product-list',{})
// })

//退出登陆
router.get('/relogin',(req,res)=>{
  req.session.destroy(()=>{
    res.redirect('/')
  })
})
module.exports = router;
